/**
 *                            License
 * THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS  
 * CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). 
 * THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW.  
 * ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR  
 * COPYRIGHT LAW IS PROHIBITED.
 * 
 * BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND  
 * AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE  
 * MAY BE CONSIDERED TO BE A CONTRACT,
 * THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED 
 * HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
 * 
 */
package lineage.ui.customize;

import java.awt.Color;
import java.awt.Font;

import javax.swing.JToolTip;

/**
 * 自定义标签提示框.
 * 
 * @version 2014年2月11日上午12:59:32
 * @author jrwz
 */
public class L1ToolTip extends JToolTip {
    private static final long serialVersionUID = 4529460989700346126L;
    /** 字体大小. */
    protected float fontSize = 12.0f;

    /**
     * 自定义标签提示框.
     */
    public L1ToolTip() {
        setBackground(Color.WHITE); // 背景颜色(白)
        setForeground(Color.BLACK); // 前景颜色(黑) - 也就是字体颜色
        // setFont(new Font("微软雅黑", 0, 12)); // 字体,样式(0:正常,1:粗体),字号
        L1Font.setFont(Font.PLAIN, fontSize);
        setFont(L1Font.getFont()); // 设置字体
    }

    // 提示框的大小
    // @Override
    // public Dimension getPreferredSize() {
    // return new Dimension(200, 100);
    // }

    /*
     * @Override
     * public void paintComponent(Graphics g) {
     * // super.paintComponent(g);
     * Graphics2D g2d = (Graphics2D) g;
     * int width = (int) (getPreferredSize().getWidth());
     * int height = (int) (getPreferredSize().getHeight());
     * Paint oldPaint = g2d.getPaint();
     * g2d.setPaint(Color.WHITE);
     * g2d.fillRect(0, 0, width, height);
     * g2d.setPaint(oldPaint);
     * 
     * if (getTipText() != null) {
     * g2d.drawString(getTipText(), 10, 20);
     * }
     * }
     */
}
